<template>
  <div :class="['coupon', 'coupon-' + size]">
    <div class="dot-container-left">
      <div class="coupon-dot" :style="{backgroundColor: dotColor}"></div>
      <div class="coupon-dot" :style="{backgroundColor: dotColor}"></div>
      <div class="coupon-dot" :style="{backgroundColor: dotColor}"></div>
      <div class="coupon-dot" :style="{backgroundColor: dotColor}"></div>
      <div class="coupon-dot" :style="{backgroundColor: dotColor}"></div>
    </div>
    <div class="coupon-left">
      <slot name="left"></slot>
    </div>
    <div class="coupon-right" :style="{borderLeftColor: dotColor}" @click="rightClick()">
      <div class="coupon-dot coupon-right-dot coupon-right-dot-top" :style="{backgroundColor: dotColor}"></div>
      <div class="coupon-dot coupon-right-dot coupon-right-dot-bottom" :style="{backgroundColor: dotColor}"></div>
      <slot name="right"></slot>
    </div>
  </div>
</template>
<style lang="scss">
  @import "../sass/var";
  @import "../sass/mixin";
  $height: 115px;
  $bgColor: #F53962;
  .coupon {
    background-image: linear-gradient(to right, $bgColor, darken($bgColor, 5));
    height: $height;
    padding: 0 12px;
    border-radius: 6px;
    position: relative;
    flex-direction: row;
    overflow: hidden;
    justify-content: space-between;
    align-items: stretch;
    &-left {
      flex: 5;
      justify-content: center;
      flex-direction: row;
      padding: 30px;
      align-items: center;
      &-text {
        color: #efefef;
        font-size: 40px;
        font-weight: 300;
      }
      &-value {
        color: #efefef;
        font-size: 60px;
        font-weight: 300;
      }
    }
    &-right {
      flex: 3;
      @include border-left(1, dashed, #fff);
      position: relative;
      /*padding: 30;*/
      justify-content: center;
      align-items: center;
      &-text {
        font-size: 50px;
        color: #efefef;
        font-weight: 300;
      }
      &-dot {
        &-top {
          position: absolute;
          top: -7px;
          left: -7px;
        }
        &-bottom {
          position: absolute;
          bottom: -7px;
          left: -7px;
        }
      }
    }
    &-dot {
      width: 14px;
      height: 14px;
      border-radius: 14px;
      background-color: #fff;
    }
    &-dot-left {

    }
    &-dot-right {
      right: -4px;
    }
  }
  .dot-container-left {
    position: absolute;
    padding: 7px 0;
    top: 0;
    bottom: 0;
    left: -7px;
    width: 14px;
    height: $height;
    justify-content: space-between;
  }
</style>
<script>

module.exports = {
  props: {
    couponValue: {default: 0},
    dotColor: {default: '#fff'}
  },

  data () {
    return {}
  },
  components: {},
  created () {
  },
  methods: {
    rightClick (e) {
      this.$emit('rightClick', e)
    }
  }
}
</script>
